$(window).load(function() {

	window.setSize = function (){
		setWidth();
		setHeight();
		if ((w/w_img) > (h/h_img)) {
			w_img_new=w+20;
			h_img_new=~~((w+20)*h_img/w_img);
		} else {
			h_img_new=h+20;	
			w_img_new=~~((h+20)*w_img/h_img);
		}
		$('#bgStretch img, #bgStretch').css({width:w_img_new, height:h_img_new});
	}
	var w_img=1200, h_img=1001;
	var w,h, num;
	setWidth();
	setHeight();
	setSize();
	function setWidth(){
		w=$(window).width();
	}
	function setHeight(){
		h=$(window).height();
	}
	$(window).resize(function(){
		setSize();
	})
})